package edu.auctionmart

class Preferences {
	
	static belongsTo = User
	
	Boolean smsShouldAlert
	Boolean ivrShouldAlert
	Boolean emailShouldAlert
	Integer smsNumber
	Integer ivrNumber
	String emailAlertAddress

    static constraints = {
		emailAlertAddress(nullable: true, email: true)
		smsNumber(nullable: true, validator: {return it == null || it.toString().length() == 10 })
		ivrNumber(nullable: true, validator: {return it == null || it.toString().length() == 10 })
		emailShouldAlert(nullable: false)
		ivrShouldAlert(nullable: false)
		smsShouldAlert(nullable: false)
    }
}
